#ifndef __SYS_H
#define __SYS_H	

#define THMAIN_PRIO         29	//* 主任务优先级
#define THUDPCOMMU_PRIO     30  //* udp通讯测试任务优先级
#define THTCPSRV_PRIO       31	//* Tcp服务器任务优先级
#define THTCPCLT_PRIO       33	//* Tcp客户端任务优先级
#define THTCPCLT1_PRIO      32	//* Tcp客户端任务优先级

#if NETTOOLS_TELNETSRV
#define THTELNETSRV_PRIO  23
#define THNVT0_PRIO       24
#define THNVT1_PRIO       25
#define THNVTCMD_PRIO     26
#endif

#define THOSTIMERCOUNT_PRIO 22	//* onps栈定时器计数任务优先级
#if SUPPORT_SACK
#define THTCPHANDLER_PRIO   21  //* onps栈tcp协议主处理线程
#endif
#define THETHIIRECV_PRIO    20	//* ethernet网卡接收任务优先级
#define MTX_PIP_START_PRIO  19	//* 协议栈用到的互斥锁起始优先级

//* 电平值
typedef enum {
	LOW  = 0,
	HIGH = 1
} ENUM_LEVEL;

typedef INT32U BOOL;

//* LED
//*=============================================================================
#define	PORT_LED    GPIOE
#define	PIN_LED1    GPIO_Pin_13
#define LED1(level) GPIO_WriteBit(PORT_LED, PIN_LED1, level ? Bit_SET : Bit_RESET)
#define	PIN_LED2    GPIO_Pin_14
#define LED2(level) GPIO_WriteBit(PORT_LED, PIN_LED2, level ? Bit_SET : Bit_RESET)
#define	PIN_LED3    GPIO_Pin_15
#define LED3(level) GPIO_WriteBit(PORT_LED, PIN_LED3, level ? Bit_SET : Bit_RESET)

//* RMII
//*=============================================================================
#define PORT_RMII0  GPIOA
#define PORT_RMII1  GPIOB
#define PORT_RMII2  GPIOC
#define RMII0_PIN   GPIO_Pin_1  | GPIO_Pin_2  | GPIO_Pin_7
#define RMII1_PIN   GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13
#define RMII2_PIN   GPIO_Pin_1  | GPIO_Pin_4  | GPIO_Pin_5

//* AT24C01
//* ============================================================================
#define AT24C_PIN_PORT        GPIOB
#define AT24C_I2C_SCL_PINSRC  GPIO_PinSource8
#define AT24C_I2C_SDA_PINSRC  GPIO_PinSource9
#define AT24C_I2C_SCL_PIN     GPIO_Pin_8
#define AT24C_I2C_SDA_PIN     GPIO_Pin_9
#define AT24C_I2C_PORT        I2C1

#endif
